local ruml_language_server_path = vim.fn.stdpath "data" .. "/mason/packages/rumdl/rumdl"

require("conform").setup {
  formatters = {
    rumdl = {
      -- Change where to find the command
      command = ruml_language_server_path,
      args = {
        "fmt", -- 使用 rumdl 的 fmt 子命令进行格式化
        "--quiet", -- 抑制诊断输出，仅输出格式化后的内容
        "-", -- 表示从标准输入读取内容
      },
      stdin = true,
    },
  },
}

local options = {
  formatters_by_ft = {
    lua = { "stylua" },
    css = { "prettierd", "biome" },
    less = { "prettierd", "biome" },
    scss = { "prettierd", "biome" },
    html = { "prettierd", "biome" },
    json = { "prettierd", "biome" },
    vue = { "prettierd", "biome" },
    python = { "yapf" },
    markdown = { "rumdl" },
    javascript = { "biome", "prettierd", "prettier", "eslint_d", stop_after_first = true },
    typescript = { "biome", "prettierd", "prettier", "eslint_d", stop_after_first = true },
  },

  -- format_on_save = {
  --   -- These options will be passed to conform.format()
  --   timeout_ms = 500,
  --   lsp_fallback = true,
  -- },
}

return options
